<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="${bpmTaskFrom.fromName}--${config.getKey('COMPANY_NAME')}" libs=["table"]/>
<link rel="stylesheet" href="${ctxStatic}/static/css/figol.css?V=${config.getDvVersion()}"/>
<style>
    table.table-form-title{margin:20px auto 0;}
    table.table-form-title td{text-align: center;border-bottom:0 !important;}
    table.table{width:90%;margin:0 auto;}
    table.table-form-attach{margin-bottom:100px;}
</style>
<div class="oa-form">
    <div class="form-bottom">
        <div class="form-bottom-left">
            <@f.form name="bidseal" class="form-horizontal">

            <div class="form-content">
                <div id="printBox" class="form-main" style="padding-bottom:60px;background-color:#fff;overflow-x:hidden;overflow-y: auto;">
                    <div style="margin:0 auto;">
                        <table class="table-form-title table" style="margin-top:20px;">
                            <tr>
                                <td colspan="4" style="border-bottom: 0 !important;">
                                    <h2>${config.getKey("COMPANY_NAME")}</h2>
                                    <h2>${bpmTaskFrom.fromName}</h2>
                                    <input type="hidden" name="processInstanceId" value="${bpmForm.processInstanceId}" />
                                </td>
                            </tr>
                            <tr>
                                <td width="15%"></td>
                                <td width="45%"></td>
                                <td width="15%"><span>发起时间：</span></td>
                                <td class="text-left">
                                    <@f.input readonly=true value="${bpmForm.createTime?string('yyyy-MM-dd')}" name="createTime" type="date" dataType="date" dataFormat="yyyy-MM-dd"
                                    placeholder="请选择时间"  butClass="fa fa-calendar-plus-o" required=true />
                                </td>
                            </tr>
                        </table>
                        <table class="table-form-head table table-hover table-bordered">
                            <tr>
                                <th>项目档案编号</th>
                                <td>
                                    <@f.input readonly=true value="${bpmForm.projectId}"  name="projectAdmin" placeholder="请输入项目经理" required=true/>
                                </td>
                                <th>项目经理</th>
                                <td>
                                    <@f.input readonly=true value="${bpmForm.projectAdmin}"  name="projectAdmin" placeholder="请输入项目经理" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>项目所属部门</th>
                                <td colspan="3">
                                    <@f.input readonly=true value="${bpmForm.projectDept}"  name="projectDept" placeholder="请输入项目所属部门" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>项目名称</th>
                                <td colspan="3">
                                    <@f.input readonly=true value="${bpmForm.projectName}"name="projectName" placeholder="请输入项目名称" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>委托单位</th>
                                <td colspan="3">
                                    <@f.input readonly=true value="${bpmForm.clientCompany}" name="clientCompany" placeholder="请输入委托单位" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>是否中标</th>
                                <td>
                                    ${dict.getLabel('sys_yes_no', bpmForm.isBided)}
                                </td>
                                <th>中标金额(元)</th>
                                <td>
                                    <@f.input readonly=true name="bidedAmount" value="${bpmForm.bidedAmount}" placeholder="请输入中标金额" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>投标保证金来源</th>
                                <td>
                                    <@f.select readonly=true name="depositFrom" dictType="bid_deposit_from" blankValue="${bpmForm.depositFrom}" blankLabel="${dict.getLabel('bid_deposit_from', bpmForm.depositFrom)}"/>
                                </td>
                                <th>投标保证金金额</th>
                                <td>
                                    <@f.input readonly=true name="depositAmount" value="${bpmForm.depositAmount}" placeholder="请输入投标保证金金额" required=true/>
                                </td>
                            </tr>
                            <tr>
                                <th>上传中标通知书</th>
                                <td colspan="3">
                                    <input type="hidden" name="bidedNoticeUrl" value="" />
                                    <div class="pull-left"></div>
                                    <div class="pull-right"><a href="#"><i class="fa icon-link"></i></a></div>
                                </td>
                            </tr>
                            <tr>
                                <th>处理意见</th>
                                <td colspan="3">
                                    <ul class="opinion-list">
                                        <#list comment as vo>
                                        <li>
                                            <div class="line1">【${vo.typeName}】${vo.message}</div>
                                            <div class="line2"><span class="author">${vo.userName}</span><span class="time">${vo.time?string("YY-MM-dd HH:mm:ss")}</span></div>
                                        </li>
                                    </#list>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <th>备注</th>
                                <td colspan="3">
                                    <@f.input readonly=true name="remark" value="${bpmForm.remark}" placeholder="请输入备注" required=true/>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>

            <div class="form-attach">
                <div style="width:90%;margin:20px auto 0;background-color:#ccc;">
                    <div class="button-attach" style="height:50px;line-height:50px;font-size:14px;background-color:#ccc;">
                        <i style="padding:0 5px 0 10px;" class="icon-attach fa fa-angle-double-down">${bpmForm.attachmentText}</i>附言
                    </div>
                    <div style="width:99%;margin:0 auto;">
                        <textarea placeholder="2000字以内" style="border:1px solid #ddd;width:100%;height:70px;"></textarea>
                    </div>
                </div>
            </div>
        </@f.form>
    </div>
    <div class="form-bottom-right" style="background-color: white;">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <@f.form id="task-form-complete" class="form-horizontal">
            <div style="width:90%;margin:20px auto 0;">
                <textarea id="comment" name="message" style="height:80px;" class="form-control" required></textarea>
                <span class="help-block m-b-none" id="tipBut">
                        <i style="color: #888" class="fa fa-info-circle"> 常用词汇：</i>
                        <button type="button" class="btn btn-xs mr5">同意</button>
                        <button type="button" class="btn btn-xs mr5">已阅</button>
                    </span>
                <script>
                    $('#tipBut button').click(function(){
                        $('#comment').text($(this).text())
                    });
                </script>
            </div>
            <div style="margin:20px auto 0;text-align:center;">
                <input name="taskId" value="${taskId}" type="hidden">
                <input name="processInstanceId" value="${bpmForm.processInstanceId}" type="hidden">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i> <@ctx.i18n text = "审批"/></button>&nbsp;
                <button type="button" class="btn btn-sm btn-danger" onclick="terminateHandler()"><i class="fa fa-mail-reply"></i> <@ctx.i18n text = "终止"/></button>&nbsp;
            </div>
        </@f.form>
    </div>
</div>
</div>
</div>

</div>
<@footer>
<script>jQuery.browser={};(function(){jQuery.browser.msie=false;jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();</script>
<script src="${ctxStatic}/static/js/jquery.jqprint.js"></script>
<script type="text/javascript">
    var prefix = baseURL + "bpm/bidopening";
    function doPrint(){
        $("#printBox").jqprint();
    }
    $('form[name=bidseal]').validate({
        rules:{
            project_name:{
                required:true,
                minlength: 1,
                maxlength: 200
            },
        },
        focusCleanup: true
    });
    //提交表单，审批通过
    function submitHandler() {
        console.log(prefix)
        opt.operate.save(baseURL + "bpm/task/complete", $('#task-form-complete').serialize());
    }
    function terminateHandler() {
        console.log(prefix)
        opt.operate.save(baseURL + "bpm/task/terminate", $('#task-form-complete').serialize());
    }
    /*预览*/
    function preview(processInstanceId) {
        var options = {
            //url: baseURL + "bpm/procdef/preview/" + id,
            url: baseURL + "bpm/processInstance/preview/" + processInstanceId,
            title: '<i class="fa icon-loop"></i> <@ctx.i18n text = "流程跟踪"/>',
            btn:['<i class="fa fa-close"></i> '+$.i18n.prop("取消")],
            width: $(top.window).width() - 300,
            height: $(top.window).height() - 200
        };
        opt.modal.openMainWin(options);
    }
    /*$("button[name=btn-save]").click(function () {
        console.log("aaaaaaaaaaaa")
        if (opt.validate.form()) {
            console.log("bbbbbbbbbbbbbbbbb")
            opt.operate.post(prefix + "/add", $('form[name=bidseal]').serialize());
        }
    });*/
    $(".button-attach").click(function () {
        $(".form-attach").toggleClass("expand");
        $(".icon-attach").toggleClass("fa-angle-double-up").toggleClass("fa-angle-double-down");
    });
    layui.use('element', function(){
        var element = layui.element;

        //…
    });
</script>
</@footer>
</@pageTheme>